import { createRouter, createWebHistory } from 'vue-router'
import Index from '../components/index.vue'
import Login from '../components/login.vue'
import Welcome from '../components/welcome.vue'
import Choose from '../components/choose.vue'
import user from '../components/user.vue'
const routes = [
  {
    path: '/',
    name: 'login',
    component: Login,
  },
  {
    path: '/index',
    name: 'index',
    component: Index,
    redirect: '/welcome',
    children: [
      {
        path: '/welcome',
        name: 'welcome',
        component: Welcome,
      },
      {
        path: '/choose',
        name: 'choose',
        component: Choose,
      },
      {
        path: '/user',
        name: 'user',
        component: user,
      }
    ]
  },

]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
